package pieces;

import java.util.ArrayList;
import model.*;

public class Rook extends SideMover
{
	private final Location originalLoc;
	public Rook(Location loc, GridGame<Piece> grid, int color)
	{
		super(loc, grid, ROOK, color);
		originalLoc = loc;
	}
	@Override
	public ArrayList<Location> getMoveLocations()
	{
		ArrayList<Location> locs = new ArrayList<Location>();
		locs.addAll(getLocationsInDirection(Location.NORTH));
		locs.addAll(getLocationsInDirection(Location.WEST));
		locs.addAll(getLocationsInDirection(Location.EAST));
		locs.addAll(getLocationsInDirection(Location.SOUTH));
		
		return locs;
	}
	public boolean hasMoved()
	{
		return originalLoc != currentLoc;
	}
	@Override
	public int getValue()
	{
		return ROOK_VALUE;
	}
}
